# -*- coding:utf-8 -*-
from django.db import models
from django_thumbs.db.models import ImageWithThumbsField
from django.conf import settings
from datetime import timedelta
# Create your models here.


class Trips(models.Model):
    title = models.CharField(max_length=100, verbose_name = u'标题')
    start_at = models.DateField()
    location = models.CharField(max_length=100)
#     duration = timedelta.TimedeltaField()
    lessons_number = models.IntegerField()
    total_count = models.IntegerField()
    sell_count = models.IntegerField()
    availabe_cnt = models.IntegerField()
    price = models.IntegerField()
    avatar_url = ImageWithThumbsField(upload_to = settings.TRIPS_AVATAR, default=settings.TRIPS_AVATAR_DEFAULT,
                                             verbose_name = u'图片')
    
    class Meta:
        verbose_name = u'路线'
        verbose_name_plural = verbose_name
    